In [1]:
%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
In [2]:
my_data = np.genfromtxt('Aug15_2017.csv', delimiter=',')

INTRODUCTION

In this file the first column is time of the day in hours. The rest of the columns are the values in the original CSV without the ID and davice Columns.

Columns 1-24 contains the SP (Set Point) variables. Variables 1-4 and 6-24 are the ones we can control. Variable 5 (Moisure SP) controls the maximum moisture that we can allow in the end. Is this correct?

Columns 25-49 and 55-56 are the measurements of the previous SPs (almost a one two one mapping, except a couple of variables).

Column 50 has infomration about product depth at the beginning of the process.

Columns 51-54 have information about energy consumption.

Columns 57-67 have information about machine status. What do they mean? Are these important?

Examples:

Variable 1: Zone 1 Temp. SP. Variable 25-27: Zone 1 Burner 1 Before Temp., Zone 1 Burner 2 Before Temp. and Zone 1 After Temp.

Variable 2: Zone 2 Temp. SP. Variable 28-29: Zone 2 Burner 1 Before Temp. and Zone 2 After Temp.

Variable 3: Zone 1 Humidity SP. Variable 30: Zone 1 Humidity.

Variable 4: Zone 2 Humidity SP. Variable 31: Zone 2 Humidity.

and so on and so forth. I have copy all the relations at the end of this file.

In [20]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,50],my_data[:,0],my_data[:,5],my_data[:,0],my_data[:,32])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Prodcut Depth','Moisture SP','Moisture'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[372*0:372*2,0],my_data[372*0:372*2,50],my_data[372*0:372*2,0],my_data[372*0:372*2,5],my_data[372*0:372*2,0],my_data[372*0:372*2,32])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Prodcut Depth','Moisture SP','Moisture'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[372*18:372*21,0],my_data[372*18:372*21,50],my_data[372*18:372*21,0],my_data[372*18:372*21,5],my_data[372*18:372*21,0],my_data[372*18:372*21,32])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Prodcut Depth','Moisture SP','Moisture'])
plt.grid(color='k', linestyle=':', linewidth=.5)
/Users/fernando/anaconda/lib/python3.6/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)

In this first plot, we show how the Product Depth changes and how the mopisture changes with the time of the day. It can be seen that the moisture has like 30-40 minutes delay with the product depth. I understand that one is measure at the beggining of the prodcess and the other at the end. Also at the end of the day (>22h) the moisture goes does to zero before there is no product is this a measurement error or too much heat in the process?

In [4]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,25],my_data[:,0],my_data[:,26],my_data[:,0],my_data[:,1])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 Burner 1 Before Temp.','Zone 1 Burner 2 Before Temp.','Zone 1 Temp. SP'])
plt.grid(color='k', linestyle=':', linewidth=.5)

In this plot it is easy to see that the SP seems to be a control vairiable and the other two are mesaurements that try to track the set variable.

In [5]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,27],my_data[:,0],my_data[:,1])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 After Temp.','Zone 1 Temp. SP'])
plt.grid(color='k', linestyle=':', linewidth=.5)

It is unclear how related are these two variables.

In [6]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,30],my_data[:,0],my_data[:,3],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 Humidity','Zone 1 Humidity SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)
plt.figure()
plt.plot(my_data[:,0],my_data[:,31],my_data[:,0],my_data[:,4],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 2 Humidity','Zone 2 Humidity SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,31],my_data[:,0],my_data[:,30],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 2 Humidity','Zone 1 Humidity','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

It can be seen that Humidity SP and Humidity are quite alike when there is product on the machine. Should we worry about this mismatch? Also the humidity in the second zone is a bit lower but not much lower. How related is humidty to moisture at the output?

In [21]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,6],my_data[:,0],my_data[:,33],my_data[:,0],my_data[:,7],my_data[:,0],my_data[:,34])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Top Bed SP','Top Bed Speed','Bottom Bed SP','Bottom Bed Speed'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,6]+my_data[:,33],my_data[:,0],my_data[:,7]+my_data[:,34])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Top Bed sum','Bottom Bed sum'])
plt.grid(color='k', linestyle=':', linewidth=.5)
/Users/fernando/anaconda/lib/python3.6/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)

It is unclear what is the relation between SP and non SP. It seems that thier sums is constant.

In [8]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,35],my_data[:,0],my_data[:,8])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 Rec. Fan 1','Zone 1 Rec. Fan 1 SP'])
plt.grid(color='k', linestyle=':', linewidth=.5)

The SP and measurement are the same and constant. The same thing happen for all the other fans (Variables 8-16 and 35-43). Also they are all set at 60, except one that it is at 55. Should we control these fans too? Does it matter?

In [9]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,44],my_data[:,0],my_data[:,17],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 Exh Damper Position','Zone 1 Exh Damper SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

These Dampers vari between 25 and 100. it is clear thatwhen the input goes to zero, the damper goes to 25 (min value) and when there is product increases and in some cases maxing at 100. Also the recorded value does not get that high.

In [10]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,45],my_data[:,0],my_data[:,18],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 MU Damper Position','Zone 1 MU Damper SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,46],my_data[:,0],my_data[:,19],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 2 Exh Damper Position','Zone 2 Exh Damper SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,47],my_data[:,0],my_data[:,20],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 2 MU Damper Position','Zone 2 MU Damper SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,48],my_data[:,0],my_data[:,21],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Cooling Zone Exh Damper Position','Cooling Zone Exh Damper SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,49],my_data[:,0],my_data[:,22],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Cooling Zone MU Damper Position','Cooling Zone MU Damper SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

It can be seen that in zone 2 the controller just jumps between mx and max, so it does not give us much of a control. For the cooling part, it seems that the first damper is at minimum and the second at the minimum value (correct?).

In [11]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,55],my_data[:,0],my_data[:,23],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 Evap Control PV','Zone 1 Evap Control SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,56],my_data[:,0],my_data[:,24],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 2 Evap Control PV','Zone 2 Evap Control SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)
In [19]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,51]/10**6,my_data[:,0],my_data[:,52]/10**4,my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Gas Consumption/10^6','Electric Power Consumption/10^4','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,32],my_data[:,0],my_data[:,54],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Moisture','Product Temperature','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)
/Users/fernando/anaconda/lib/python3.6/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)

It can be seen that the Gas cosumption changes significantly with the product depth, while the eletric consuption is fairly constant.

COMMENTS

Some problems that, we can see with the controller:

1 The changes in variables seems to depend on the product, but the changes seems to be instant in both zones. But if the prodcut takes 30-50 minutes to go through the machine, the changes in Zone 2 should be delayed by 10-20 minutes (I do not say 15-20 because we might anticipate changes). For example, for the SP temperature the changes in Zone 2 and 1 are colinear in values and times. For the damper is even more so, because the zone 1 and 2 goes down at the same time, when the prodcut depth goes to zero, but then zone 2 grows sooner.

In [13]:
plt.figure()
plt.plot(my_data[:,0],my_data[:,1],my_data[:,0],my_data[:,2],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 Temp. SP ','Zone 2 Temp. SP ','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)

plt.figure()
plt.plot(my_data[:,0],my_data[:,17],my_data[:,0],my_data[:,19],my_data[:,0],my_data[:,50])
plt.xlabel('Time of the day [hours]')
plt.ylabel('Quantity')
plt.legend(['Zone 1 Exh Damper SP','Zone 2 Exh Damper SP','Product Depth'])
plt.grid(color='k', linestyle=':', linewidth=.5)
/Users/fernando/anaconda/lib/python3.6/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)

Conclusions

For me what it seems that we have a very fine sampiling (ever 10s), but the prodcut stays in each zone for more than 10 minutes. So the controller needs to take into account that it is not acting on a given sample instantenously, but in 10 minutes of prdouct. We need to control the moisture of a distribution of product and we need to take into account what are the goals in the distribution.

In order to create a good model we need to know more about delays. For example since we measure the product deep and it goes into the machine how long does it take? The longer it takes the better because we have more time to prepare for the changes that are coming?

We need to understand where are the sensors in each zone and how many zones there are in the machine. I have counted 3: Zone 1, Zone 2 and Cooling (Is this correct)? How large are each one of them? This is important to understand the speed and how long does it take to go through each zone.

We need to understand what we can change and by how much and which are the effect of each change?

We need to understand the costs of under and over-heating, specially when the product depth changes, because that means that the shallow part of the product will be over-heated and the thicker part under-heated. The good thing about having instantaneous measuraments every 10 seconds and the Zone one being long, allows to fine tune the heat in the second zone.

We need to understand what are the variables that make sense to change and what does each one of them to the gas and electricity consuption. Should we focus on one of them specifically?

We also need to know about delays from decision to implementation?

When the machine is not working, we should not consider the measurements, because they are not measuring change. Correct? There are times in which the product density os low or zero, but the machine is working in others in which the machine is not working. These are two different conditions.

Variables and comments about this day

1 Zone 1 Temp. SP -> 25 Zone 1 Burner 1 Before Temp. / 26 Zone 1 Burner 2 Before Temp. / 27 Zone 1 After Temp. 2 Zone 2 Temp. SP -> 28 Zone 2 Burner 1 Before Temp. / 29 Zone 2 After Temp.
3 Zone 1 Humidity SP -> 30 Zone 1 Humidity not a perfect match. It is a match when there is product. 4 Zone 2 Humidity SP -> 31 Zone 2 Humidity not a perfect match 5 Moisture SP -> 32 Moisture related at best. 6 Top Bed SP -> 33 Top Bed Speed One to one mapping but weird. 7 Bottom Bed SP -> 34 Bottom Bed Speed One to one mapping but weird. 8 Zone 1 Rec. Fan 1 SP -> 35 Zone 1 Rec. Fan 1 Speed perfect match and constant at 60 9 Zone 1 Rec. Fan 2 SP -> 36 Zone 1 Rec. Fan 2 Speed perfect match and constant at 60 10 Zone 1 Rec. Fan 3 SP -> 37 Zone 1 Rec. Fan 3 Speed perfect match and constant at 60 11 Zone 1 Rec. Fan 4 SP -> 38 Zone 1 Rec. Fan 4 Speed perfect match and constant at 60 12 Zone 2 Rec. Fan 1 SP -> 39 Zone 2 Rec. Fan 1 Speed perfect match and constant at 60 13 Zone 2 Rec. Fan 2 SP -> 40 Zone 2 Rec. Fan 2 Speed perfect match and constant at 60 14 Zone 2 Rec. Fan 3 SP -> 41 Zone 2 Rec. Fan 3 Speed perfect match and constant at 60 15 Exhaust Fan SP -> 42 Exhaust Fan Speed perfect match and constant at 55 16 Transfer Fan SP -> 43 Transfer Fan Speed perfect match and constant at 60 17 Zone 1 Exh Damper SP -> 44 Zone 1 Exh Damper Position almost a perfect match not constant (varies between min and max) 18 Zone 1 MU Damper SP -> 45 Zone 1 MU Damper Position almost a perfect match not constant (varies between min and max) 19 Zone 2 Exh Damper SP -> 46 Zone 2 Exh Damper Position almost a perfect match not constant (varies between min and max) 20 Zone 2 MU Damper SP -> 47 Zone 2 MU Damper Position almost a perfect match not constant (varies between min and max) 21 Cooling Zone Exh Damper SP -> 48 Cooling Zone Exh Damper Position almost a perfect match (constant) 22 Cooling Zone MU Damper SP -> 49 Cooling Zone MU Damper Position almost a perfect match (constant) 23 Zone 1 Evap Control SP -> 55 Zone 1 Evap Control PV related, sometimes very good predictor 24 Zone 2 Evap Control SP -> 56 Zone 2 Evap Control PV related, sometimes very good predictor

50 Product Depth varies significantly (correlated with moisture delayed) 51 Gas Consumption changes significantly with depth 52 Electric Power Consumption changes little with depth 53 Gas Temperature grows when there is no product, but not only. 54 Product Temperature decreases with product depth, aligned with moisture.

57 Machine Status related to depth 4 values 10^{4,5,8,10} 58 Alarm Status two values either 0 or 2. Correlated with depth but not perfectly. 59 Operating Mode always 1. 60 Ready to Feed always 1. 61 Discharge Running always 1. 62 Zone 1 Burner 1 Status mostly 2 sometimes 1. 63 Zone 1 Burner 2 Status mostly 2 sometimes 1. 64 Zone 2 Burner 1 Status always 2 65 Zone 1 Burner 1 Interlocks two values unclear. 66 Zone 1 Burner 2 Interlocks two values unclear. 67 Zone 2 Burner 1 Interlocks two values unclear.

In [ ]: